﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;

namespace NetDisk
{
    /// <summary>
    /// Interaction logic for Shell.xaml
    /// </summary>
    [Export]
    public partial class Shell : Window
    {
        private const string LoginModuleName = "HierarchyModule";
        private const string LoginViewUri = "/Hierarchy";
        [ImportingConstructor]
        public Shell(IModuleManager moduleManager, IRegionManager regionManager)
        {
            InitializeComponent();
            moduleManager.LoadModuleCompleted += (sender, args) =>
            {
                if (args.ModuleInfo.ModuleName == LoginModuleName)
                    regionManager.RequestNavigate("MainRegion", LoginViewUri);
            };
        }
    }
}
